import { createApp } from 'vue'
// import './style.css'
import './styles/index.scss';
import App from './App.vue'
import { setupStore } from './store'
import { setupCustomComonents } from './plugin/customComponents'
import { setupDirectives } from './plugin/directives'
import router, { setupRouter } from './router'

async function initApp() {
    const app = createApp(App)
    // 注册全局公共组件
    setupCustomComonents(app)
    // 注册全局自定义指令
    setupDirectives(app)
    // 挂载状态管理
    await setupStore(app)
    // 挂载路由
    await setupRouter(app)
    // 路由准备就绪后挂载APP实例
    await router.isReady()

    app.mount('#app')
}
initApp()
